package com.example.index.controller;

import com.example.index.entity.Images;
import com.example.index.service.ImagesService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;

import javax.annotation.Resource;
import java.util.List;


@Controller
public class ImagesController {

    @Resource
    private ImagesService imagesService;
    @GetMapping("schoolImages")
    public String schoolImages(ModelMap modelMap) {
        Page<Images> clubActivities = imagesService.queryByPage(new Images(), PageRequest.of(0, 1000));
        List<Images> ImagesList = clubActivities.getContent();
        System.out.println(ImagesList);
        modelMap.addAttribute("ImagesList",ImagesList);
        return "schoolImages";
    }

}
